{template 'common/header'}
<ul class="nav nav-tabs">
    <li {if $op=='list' } class="active" {/if}>
        <a href="{php echo $this->createWebUrl('order_user', array('op' => 'list'));}">订单列表</a>
    </li>
</ul>
{if $op=='list'}
<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
				<input type="hidden" name="c" value="site" />
				<input type="hidden" name="a" value="entry" />
				<input type="hidden" name="m" value="{php echo $this->modulename}" />
				<input type="hidden" name="do" value="order_user" />
				

				<div class="form-group">
					<label class="col-xs-12 col-sm-1 control-label">订单号搜索</label>
					<div class="col-sm-2 col-xs-12">
						<input class="form-control" name="keyword2" id="" type="text" value="{$_GPC['keyword2']}" placeholder="根据订单号搜索">
					</div>
					<div class="col-sm-2 col-xs-12">

                        <select name="keyword1" class="form-control">

						    <option value="" >全部</option>

                           <option value="meituan" {if $_GPC['keyword1']=='meituan'}selected="selected"{/if}>美团联盟</option>

							 <option value="fenxiao" {if $_GPC['keyword1']=='fenxiao'}selected="selected"{/if}>美团分销联盟</option>

                            <option value="elm" {if $_GPC['keyword1']=='elm'}selected="selected"{/if}>饿了么</option>

							<option value="movie" {if $_GPC['keyword1']=='movie'}selected="selected"{/if}>电影票</option>

							<option value="jd" {if $_GPC['keyword1']=='jd'}selected="selected"{/if}>京东</option>

							<option value="pdd" {if $_GPC['keyword1']=='pdd'}selected="selected"{/if}>拼多多</option>

							<option value="wph" {if $_GPC['keyword1']=='wph'}selected="selected"{/if}>唯品会</option>

							<option value="tb" {if $_GPC['keyword1']=='tb'}selected="selected"{/if}>淘宝联盟</option>

							<option value="jutuike" {if $_GPC['keyword1']=='jutuike'}selected="selected"{/if}>聚推客联盟</option>

                        </select>

                    </div>
					<div class="col-sm-5">
						<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
						<button type="button" class="btn btn-default">总记录数：{$total}</button>
					</div>
				</div>
			</form>
		</div>
</div>

<form action="" class="form-horizontal form" method="post" enctype="multipart/form-data">
    <div style="padding:15px;">
        <table class="table table-hover table-condensed">
            <thead class="navbar-inner">
                <tr>
                    <tr>

                    <th>id</th>

                    <th>平台</th>

					<th>类型</th>

                    <th>状态</th>

					<th>用户</th>

					<th>用户UID</th>

					<th>订单号</th>

					 <th>订单金额</th>

					 <th>佣金</th>

					 <th>佣金级别</th>

                    <th>商品名</th>

                    <th>付款时间</th>

                </tr>
            </thead>
                <tbody id="level-list">

                {loop $list $item}
                <tr>

                    <td>{$item['id']}</td>
					<td>{if $item['pingtai'] == 'meituan'}美团联盟{elseif $item['pingtai'] == 'elm'}饿了么{elseif $item['pingtai'] == 'fenxiao'}美团分销联盟{elseif $item['pingtai'] == 'movie'}电影票{elseif $item['pingtai'] == 'jd'}京东{elseif $item['pingtai'] == 'pdd'}拼多多{elseif $item['pingtai'] == 'wph'}唯品会{elseif $item['pingtai'] == 'tb'}淘宝联盟{elseif $item['pingtai'] == 'jutuike'}聚推客联盟{/if}</td>

					<td>{$item['pingtai_name']}</td>

					{if $item['order_settlement_time'] > 0}

					<td>已发放</td>

					{else}

					<td>{if $item['order_status'] == 8 || $item['order_status'] == 3 || $item['order_status'] == 14 || $item['order_status'] == 17 || $item['order_status'] == 18 || $item['order_status'] == 102 || $item['order_status'] == 103}已完成{/if}{if $item['order_status'] == 1 || $item['order_status'] == 12 || $item['order_status'] == 15 || $item['order_status'] == 101}已付款{/if}{if $item['order_status'] == 9 || $item['order_status'] == 13 || $item['order_status'] == 100 || $item['order_status'] == 104}已取消{/if}</td>

					{/if}

					

					<td>
					<?php
					    $user = array();
					    if($settings['system_type'] == 1){
						    if(!$item['c_1_uid']){$item['c_1_uid'] = $item['c1_uid'];}
						    $user = pdo_get($this->modulename . "_user_u", array("uid" => $item['c_1_uid'],'system_id' => $settings['system_id']));
						}else{
						    if(!$item['c_1_uid']){$item['c_1_uid'] = $item['c1_uid'];}
						    $user = pdo_get($this->modulename . "_user", array("uid" => $item['c_1_uid'],'uniacid' => $_W['uniacid']));
						}
				        
				    ?>

                        <img style="width: 40px;" src="{$user['avatar']}">

                        {$user['nickname']}

                    </td>

					<td>{$user['uid']}</td>

					<td>{$item['order_id']}</td>

					<td>￥{$item['order_price']}</td>
					{if $item['c_1_uid'] == $_GPC['uid']}
					<td>￥{$item['c_1']}</td>
					{elseif $item['c_2_uid'] == $_GPC['uid']}
					<td>￥{$item['c_2']}</td>
					{elseif $item['c_3_uid'] == $_GPC['uid']}
					<td>￥{$item['c_3']}</td>
					{elseif $item['c_t_uid'] == $_GPC['uid']}
					<td>￥{$item['c_t']}</td>
					{elseif $item['c_2t_uid'] == $_GPC['uid']}
					<td>￥{$item['c_2t']}</td>
					{elseif $item['c_1h_uid'] == $_GPC['uid']}
					<td>￥{$item['c_1h']}</td>
					{elseif $item['c_2h_uid'] == $_GPC['uid']}
					<td>￥{$item['c_2h']}</td>
					{elseif $item['c_3h_uid'] == $_GPC['uid']}
					<td>￥{$item['c_3h']}</td>
					{elseif $item['c_4h_uid'] == $_GPC['uid']}
					<td>￥{$item['c_4h']}</td>
					{else}
					<td>￥{$item['order_profit']}</td>
					{/if}

					{if $item['c_1_uid'] == $_GPC['uid']}
					<td>自购/自推</td>
					{elseif $item['c_2_uid'] == $_GPC['uid']}
					<td>直推</td>
					{elseif $item['c_3_uid'] == $_GPC['uid']}
					<td>间推</td>
					{elseif $item['c_t_uid'] == $_GPC['uid']}
					<td>团长/合伙人间推</td>
					{elseif $item['c_2t_uid'] == $_GPC['uid']}
					<td>团长间属团长</td>
					{elseif $item['c_1h_uid'] == $_GPC['uid']}
					<td>合伙人直属团长</td>
					{elseif $item['c_2h_uid'] == $_GPC['uid']}
					<td>合伙人间属团长</td>
					{elseif $item['c_3h_uid'] == $_GPC['uid']}
					<td>合伙人直属合伙人</td>
					{elseif $item['c_4h_uid'] == $_GPC['uid']}
					<td>合伙人间属合伙人</td>
					{else}
					<td>订单全部佣金</td>
					{/if}

					<td>{$item['goods_title']}</td>

					<td><div class="type-parent">{if $item['order_paid_time']}{php echo date('Y-m-d H:i:s',$item['order_paid_time'])}{/if}</div></td>


                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
</form>

{/if}
{template 'common/footer'}
